package com.central.common.feign.fallback

import com.central.common.feign.WxService
import feign.hystrix.FallbackFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory

/**
 * @author  fly
 * @date  2021/5/26 18:33
 * @version 1.0
 */

open class WxServiceFallbackFactory : FallbackFactory<WxService> {

    private val log: Logger = LoggerFactory.getLogger(WxServiceFallbackFactory::class.java)

    override fun create(p0: Throwable?): WxService = object : WxService {

        override fun login(code: String): String? {

            log.error("通过code: $code 获取openId失败")
            return null
        }
    }
}